JBoss Fuse Technology Overview

Red Hat JBoss Fuse Integration Partner Day

Charles Moulliard (@cmoulliard)
Architect, Engineer & Committer

13th of May - 2014

Agenda

  • Projects timeline

  • High level presentation

  • Technology overview

  • Architectures design

  • Demos

Projects timeline

  • A few things about Fuse & OpenSource

HistoryOfFuse

Agenda

  • Projects timeline

  • High level presentation

  • Technology overview

  • Architectures design

  • Demos

High level presentation

2 products JBoss Fuse & AMQ * Designed around Multi-Technology OSGI Container * Packaging of Open Sources projects : - Camel, - Cxf, - ActiveMQ, - Fabric8, - Hawtio

High level presentation

jboss fuse

High level presentation

jboss amq

High level presentation - con’t

basic 1

High level presentation - con’t

basic 2

High level presentation - con’t

basic 3

High level presentation - con’t

advanced 1

High level presentation - con’t

advanced 2

Agenda

  • Projects timeline

  • High level presentation

  • Technology overview

  • Architectures design

  • Demos

Integration

hub

  • Integration is    really hard

  •    protocols, standards, data formats, systems

  • Long story since Common Object Request Broker Architecture

Integration - con’t

producer-consumer

  • Concept

    • Decouple Producer from Consumer

    • Message transport information

Integration - con’t

bus

  •    Layer to transport messages : BUS

  •    ESB, JBI, SCA

jbi

Camel

camel box small
  • OpenSource Java Integration Framework

  • Designed around : Domain Specific Language

  • Implement Enterprise Integration Patterns

book

Camel - con’t

  • > 50 patterns implemented

  • and more : Loadbalancer, Throttler, Delayer, …

patterns
patterns 3

Camel - con’t

factory

  • Key features

    • Component

    • Endpoint

    • Consumer

    • Producer

Camel - con’t

  • Key features : route, processor

pipeline

Camel - con’t

  • Interceptor : trace, log, capture business events

pipeline2

Camel - con’t

camel-features

  • Container for the routes    CamelContext

Camel - con’t

camel-features2

  • Cross communication not allowed using direct, seda

Camel - con’t

camel-features3

  • But possible Using BUS like NMR, Broker, Shared Component with direct-vm, vm

Camel - con’t

type-converter

  • Type Converter Strategy

  • Allow to convert the body payloads from one type to another

  • To and From these types

    • File

    • String

    • byte[] and ByteBuffer

    • InputStream and OutputStream

    • Reader and Writer

Camel - con’t

  • Data Transformation for complex use case

package org.devnation.camel;

import java.io.InputStream;
import java.io.OutputStream;
import org.apache.camel.Exchange;

public interface DataFormat {

    void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception;

    Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
}
  • Marshalling : Object XML (JAXB)

  • Unmarshalling : XML Object (JAXB)

Camel - con’t

dataformat 2

Camel - con’t

inonly

Camel - con’t

inout

Camel - con’t

  • Fluent API

package org.devnation.camel;

import org.apache.camel.builder.RouteBuilder;

public class ExampleRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {

        from("amq:queue:quotes")
           .filter().xpath("/quote/product/ = 'widget")
                .bean("QuotesService", "widget")
           .filter().xpath("/quote/product/ = 'gadget")
                .bean("QuotesService","gadget");

    }
}

Camel - con’t

  • Alternative : Spring, Blueprint DSL

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    ">
    <bean id="quotesService" class="org.devnation.camel.QuotesService"/>"

    <camelContext  xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="amq:queue:quotes"/>
            <filter>
                <xpath>"/quote/product/ = 'widget"</xpath>
            </filter>
                <bean id="quotesService" method="widget"/>
            <filter>
                <xpath>"/quote/product/ = 'gadget"</xpath>
            </filter>
            <bean id="quotesService" method="gadget"/>
        </route>
    </camelContext>

</beans>

Camel - con’t

  • In memory bus / alternative to JBI, SCA, NMR

  • Transport objects : XML, File, Stream, Bytes

  • Predicate & Expression language (xslt, xpath, …)

  • Sync/Async exchanges

  • Threads Management,

  • Tx Architecture

  • Error and exception handling

  • Policy driven

  • Container agnostic

Camel - con’t

components

Apache CXF

  • Simplify creation & deployment of web/REST services

  • 2 approaches “java wsdl” or “wsdl java”

  • Support :

    • JAX-WS : Web Services (XML/SOAP)

    • JAX-RS : REST service (JSON)

    • SOAP 1.1, 1.2, WSDL 1.1, WS-Security, WS-Addressing, WS-RM

fabric cxf

Apache CXF - con’t

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${basedir}/src/main/resources/myService.wsdl</wsdl>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Apache CXF - con’t

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xmlns:cxf="http://camel.apache.org/schema/cxf"
...

<cxf:cxfEndpoint id="reportIncident"
    address="http://localhost:{{port}}/camel-example/webservices/incident"
    wsdlURL="etc/report_incident.wsdl"
    serviceClass="org.apache.camel.example.ReportIncidentEndpoint"/>
...

<route>
      <from uri="cxf:bean:reportIncident"/>
      <convertBodyTo type="org.apache.camel.example.reportincident.InputReportIncident"/>
      <transform>
        <method bean="responseBean" method="getOK"/>
      </transform>

Apache Karaf karaf-logo

  • Java Micro-Container

  • OSGI Runtime

  • Offer modularity for Services

  • Multi-Technology platform

ship containers

Apache Karaf - con’t

  • SSH server

  • Administration platform (local, remote, web, jmx)

  • Provisioning system (features)

  • Hot deployment and configuration management

  • Instances management

  • Security integration (JAAS)

Apache Karaf - con’t

karaf-runtime

  • Technology    Camel, CXF, ActiveMQ, Spring, Fabric, …

  • Modular platform (deploy or remove container/libraries)

Apache ActiveMQ

  • High performance, reliable JMS messaging fabric

  • Supporting JMS, C, C++, .Net, Stomp clients

broker-architecture

Apache ActiveMQ - con’t

  • Point to Point

    • Producer sends messages to a queue.

    • Consumer listens for messages from the queue

    • Messages are stored until read (or expired)

    • Messages can be persisted, are read only once.

point to point

Apache ActiveMQ - con’t

  • Publish To Subscribe

    • A JMS client sends message to the topic.

    • JMS broker sends message to all subscribers that are currently alive.

    • Messages are consumed x times (relation 1 to many)

publish subscribe

Fabric8

  • Opensource integration project - http://fabric8.io

  • Goals :

    • Configuring, provisioning & running Fuse on any machines physical, virtual, private, public, cloud …

    • Virtualize services (endpoints), processes

    • Propose ElasticSearch Storage engine (insight)

Fabric8 - con’t

fabric-3

  • Karaf can create new instances (locally) & administrate them (locally or remotely)

  

  • Instances are not “cloned”

  • Configurations must be updated (manually)

Fabric8 - con’t

  • Fabric extend the possibilities

fabric-4

Fabric8 - con’t

  • Management rely on    Zookeeper server (ensemble of 1,3, 5 or servers)   

fabric-1

Fabric8 - con’t

& Fabric Agents

fabric-2

  • They will communicate with Zk server to :

   register container info (ports, services, endpoints, processes)

   get their provisioning

Fabric8 - con’t

  • Provisioning = Behavior of a container, achieved with Profiles

  • Enveloppe(s) containing artifacts to be deployed or parameters to be configured

  • Can be versioned, facilitate mngt - rollback

fabric 5

Fabric8 - con’t

  • Virtualization    Create “indirection” points

  • Load balancing and failover

  • Easy elastic scaling of services

  • High-availability, Replication

Fabric8 - con’t

fabric camel

Fabric8 - con’t

fabric activemq

Fabric8 - con’t

  • Insight Technology   

  • NoSQL storage for JSon documents

  • Designed around ElasticSearch

elasticsearch1
float

Fabric8 - con’t

  • Dashboard

kibana3
  • Full Text Search features

lucene logo

Fabric8 - con’t

  • Collect

    • Logs,

    • Camel metrics,

    • JMX metrics,

    • Own data metrics

Fabric8 - insight

400

Fabric8 - insight

80%

Fabric8 - insight

80%

Fabric8 - insight

  • Create a bean recuperating Message/Exchange using @Header, @Body

  • Store it using org.fusesource.insight.storage.StorageService

import org.apache.camel.Header;
import org.fusesource.insight.storage.StorageService;
import java.sql.Timestamp;
import java.util.Date;

public class StoreService {

    private static String ES_TYPE = "insight-tweet";
    private static StorageService storageService;

    public static void store(@Header("tweet-full") String data) {
        storageService.store(ES_TYPE, generateTimeStamp(), data);
    }

Hawtio

hawtio-logo-bigger

  • Lightweight & modular HTML5 web console with plugins for managing Java MBeans

  • Javascript / REST front end    jolokia JMX translator

  • Heart of the new Fuse Management Console

  • 100    100    100    150

Hawtio - con’t

  • Extend the dashboard & plugins

  • TODO

Hawtio - con’t

hawtio-1

Hawtio - con’t

hawtio-2

Hawtio - con’t

hawtio-3

Hawtio - con’t

hawtio-4 hawtio-5

Agenda

  • Projects timeline

  • High level presentation

  • Technology overview

  • Architectures design

  • Demos

Messaging

  • The BUS operates the exchanges between the endpoints using Camel (local) or NMR (global)

messaging

Messaging & Java Beans

  • Decoupling "services" from integration layer

messaging java

Messaging & Java & Web

  • Karaf runs Jetty Web Server

  • Web Project can be registered using OSGI HTTP Service

messaging java web

Distributed

distributed

Agenda

  • Projects timeline

  • High level presentation

  • Technology overview

  • Architectures design

  • Demos

Demos

  • Apache Camel & WebServices

  • Apache Karaf - POJO + Messaging + Web

  • Apache ActiveMQ - High Availability with Network of Brokers

  • Fabric8 - Virtualization of Camel endpoints / loadbalancing

Questions

questions

  • Twitter : @cmoulliard

  • More info   

    • www.jboss.org/products/fuse.html

    • www.redhat.com/products/jbossenterprisemiddleware/fuse/